package com.ming.service.impl;

import com.ming.dao.UserDao;
import com.ming.service.UserService;
import org.springframework.beans.factory.InitializingBean;

public class UserServiceImpl implements UserService, InitializingBean {

    public void init() {
        System.out.println("初始化方法...");
    }

    public void destory() {
        System.out.println("销毁方法...");
    }

    public UserServiceImpl() {
        System.out.println("UserServiceImpl无参实例化...");
    }

    public UserServiceImpl(String name) {
        System.out.println("UserServiceImpl有参实例化...");
    }

    /**
     * BeanFactory 去调用该方法，从容器中获得userDao设置到此处
     *
     * @param userDao
     */
    public void setUserDao(UserDao userDao) {
        System.out.println("BeanFactory 去调用该方法，从容器中获得userDao设置到此处：" + userDao);
    }

    public void afterPropertiesSet() throws Exception {
        System.out.println("afterPropertiesSet...");
    }
}
